package org.shiwen.week2.answer;

import java.util.Arrays;

public class q4 {
    public static void main(String[] args)
    {
        int a[]={25,63,54,91,14,5,17,25,88,32,44};
        Arrays.sort(a);
        System.out.println(Arrays.toString(a));
        int num1 = 14 ;
        int index = Arrays.binarySearch(a,num1);
        if(index>=0){
            System.out.println("数字14在数组中的索引为："+index);
        }else{
            System.out.println("数组中不存在该元素");
        };
        int num2 = 88 ;
        index = Arrays.binarySearch(a,num2);
        if(index>=0){
            System.out.println("数字88在数组中的索引为："+index);
        }else{
            System.out.println("数组中不存在该元素");
        }
    }
}
